package com.cn.rzx.system.service.impl;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.cn.rzx.system.dao.IUserDao;
import com.cn.rzx.system.pojo.User;
import com.cn.rzx.system.service.IUserService;

@Service("userService")
public class UserServiceImpl implements IUserService {

	private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);

	@Resource
	private IUserDao userDao;
	
	public User getUserById(int userId) {
		User user = new User();
		try{
			user = userDao.getUserById(userId);
		}catch (Exception e){
			logger.error("用户登录失败：{}", e.getMessage(), e);
			return null;
		}
		return user;
	}

}
